_units = _this select 0; 
 
groups = []; 
{ 
    _g = group _x; 
    if (!(_g in groups)) then 
    { 
        groups = groups + [_g]; 
    }; 
} forEach _units; 
 
groups